package com.yuexunit.operationman.nbsy.module.Login.adapter;

import android.view.View;
import android.widget.AbsListView;
import android.widget.TextView;

import com.yuexunit.operationman.nbsy.R;
import com.yuexunit.operationman.nbsy.module.Login.bean.PatientBean;

import org.kymjs.kjframe.widget.AdapterHolder;
import org.kymjs.kjframe.widget.KJAdapter;

import java.util.Collection;

/**
 * Created by Administrator on 2018/2/28 0028.
 */

public class SearchListAdapter extends KJAdapter<PatientBean.ObjectEntity> {

    public SearchListAdapter(AbsListView view, Collection mDatas, int itemLayoutId) {
        super(view, mDatas, itemLayoutId);
    }

    @Override
    public void convert(AdapterHolder adapterHolder, PatientBean.ObjectEntity item, boolean isScrolling) {
        adapterHolder.setText(R.id.item_search_name, "手术名称:"+item.getOperandi());
        adapterHolder.setText(R.id.item_search_date, "手术日期:"+item.getOperationDateStr());
        TextView item_search_status = adapterHolder.getView(R.id.item_search_status);
        if(item.getHisStatus()!=null&&item.getHisStatus().equals("3"))
        {
            item_search_status.setVisibility(View.VISIBLE);
        }
        else {
            item_search_status.setVisibility(View.GONE);
        }
    }
}
